-
Couldn't load subscription status.
- Fork 0
Proper timezone handling for schedules #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jrauh01
wants to merge
16
commits into
main
Choose a base branch
from
fix/schedule-timezone-handling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+394
−59
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
efafe1d to
1b6de94
Compare
229f6a8 to
edfee49
Compare
Add dropdown menu to choose schedule timezone.
1b6de94 to
c8bafa8
Compare
A dropdown menu to pick a timezone.
c8bafa8 to
3cb60de
Compare
To change the timezone to display the schedule in. Per default the timezone the schedule is created in is used.
`ScheduleDateTimeFactory` is a factory class to create DateTime objects in a specific timezone that is set in a static attribute.
Use the chosen value from the timezone picker control to set the timezone attribute in `ScheduleDateTimeFactory`.
Makes use of `ScheduleDateTimeFactory`.
A Widget that represents a warning if the display timezone differs from the schedule timezone. It's used for the forms to add and edit rotations.
...if the display timezone differs from the schedule timezone.
Use the schedule timezone to configure rotations. All times entered are handled in the schedule timezone.
This is because we want to remove the parentheses for future changes where those should be used to display a time in another timezone.
In the dropdown menu in the rotation config form show times in the display timezone in parentheses next to the normal time (schedule timezone).
... if the display timezone differs.
3cb60de to
d0028ce
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces timezone support for schedules. It relies on the
schedule.timezonecolumn in the database added in Icinga/icinga-notifications#344.For the following explanation, it is important to understand the difference between schedule and display timezone.
Schedule List
The timeline part has been removed completely, so that we don't have to create a header for each schedule which wouldn't be very well readable.
Schedule Creation
The form to create a new schedule now has a dropdown menu to select the timezone the schedule will be created for. Once created, the timezone cannot be changed via the web UI, because the dropdown won't be displayed for the
editAction(). This is ensured with a bool$showTimezoneDropin theScheduleFormwhich defaults tofalse. The dropdown's default is the same timezone as in the the user's preferences. The value of the dropdown will be stored in theschedule.timezonecolumn.ScheduleDateTimeFactory
The
ScheduleDateTimeFactoryis a util factory class which stores a display timezone statically and createsDateTimeobjects from it.Schedule Detail View
The
ScheduleDateTimeFactoryis used to create theDateTimeobjects that represents the timeline start and the clock that indicates the current time in the timezone the user wants to display the schedule in. Therotation.actual_handoffandtimeperiod_entry.start_timeare stored as unix timestamps, so the entries are displayed correctly in the timeline grid. Additionally all date formatters are constructed with the right timezone, so all titles are displayed correctly.Currently the user changes the display timezone via a dropdown control called
TimezonePicker. This dropdown is temporarily added for development purposes and won't be in the final version.Rotation Config Form
All configurations in the form are done in the schedule timezone, no matter what display timezone is chosen. The
RotationConfigFormis now constructed with the display timezone. If the display timezone differs following will happen:The dropdowns to select times did show 'Next Day' hints earlier. This logic has been replaced by an own option group for next day elements.
Requires Icinga/icinga-notifications#344
Fixes #273